﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CRM.Models.TrainingsRequestsExt>" %>
<%@ Import Namespace="CRM.Resourses" %>




<% Html.DevExpress().GridView(settings =>
                                    {
                                        settings.Name = "gdTrainingsParticipant";
                                        settings.KeyFieldName = "IdTrainingsParticipant";
                                        settings.CallbackRouteValues =
                                            new { Controller = "TC", Action = "TrainingsRemoteRequestCreatePartial", key = Model.Request.IdTrainingsRequest};
                                        settings.SettingsPager.PageSize = 20;

                                        settings.Columns.Add(column =>
                                        {
                                            column.Caption = Resourses.Name;
                                            column.FieldName = "ParticipantName";
                                            settings.Width = 100;
                                        });

                                        settings.Columns.Add(column =>
                                        {
                                            column.Caption = Resourses.TrainingsPosition;
                                            column.FieldName = "ParticipantPosition";
                                            settings.Width = 100;
                                        });

                                        settings.CommandColumn.Visible = true;
                                        settings.CommandColumn.NewButton.Visible = true;
                                        settings.CommandColumn.DeleteButton.Visible = true;
                                        settings.CommandColumn.EditButton.Visible = true;
                                        settings.SettingsBehavior.ConfirmDelete = true;
                                        settings.SettingsEditing.Mode = GridViewEditingMode.EditFormAndDisplayRow;
                                        settings.Width = 500;
                                        settings.SettingsEditing.AddNewRowRouteValues = new { Controller = "TC", Action = "TrainingsRemoteRequestCreatePartialAdd", key = Model.Request.IdTrainingsRequest };
                                        settings.SettingsEditing.DeleteRowRouteValues = new { Controller = "TC", Action = "TrainingsRemoteRequestCreatePartialDelete", key = Model.Request.IdTrainingsRequest };
                                        settings.SettingsEditing.UpdateRowRouteValues = new { Controller = "TC", Action = "TrainingsRemoteRequestCreatePartialUpdate", key = Model.Request.IdTrainingsRequest };
                                    }).Bind(Model.ParticipantsList).GetHtml();
%>
